
<div id="ad_left">
  <img src="/images/side-ad-rental.gif" />
</div>

<?php if($sf_user->hasFlash('notice')):?>
<div id="notice">
    <?php echo $sf_user->getFlash('notice')?>
</div>
<script type="text/javascript">
  Effect.Fade('notice',{duration:3.0});
</script>
<?php endif;?>

<div id="showcartop">
  <h1><?php echo $vehicle->getName()?></h1>
  <h2>$<?php echo number_format($vehicle->getPrice())?></h2>
  <h3>Stock #: <?php echo $vehicle->getStockId()?></h3>
</div>


<div id="details">
  <table id="des-table">
    <tr>
      <th>Year:</th>
      <td><?php echo $vehicle->getYear()?></td>
    </tr>
    <tr>
      <th>Transmission:</th>
      <td><?php echo $vehicle->getTransmissionName()?></td>
    </tr>
    <tr>
      <th>Engine:</th>
      <td><?php echo $vehicle->getEngine()?>cc</td>
    </tr>
    <tr>
      <th>Kilometres:</th>
      <td><?php echo $vehicle->getMileage()?>km</td>
    </tr>
    <tr>
      <th>Body Type:</th>
      <td><?php echo ucfirst($vehicle->getBodyStyle()->getName())?></td>
    </tr>
    <tr>
      <th>Fuel:</th>
      <td><?php echo $vehicle->getFuelName()?></td>
    </tr>
    <tr>
      <th>Color:</th>
      <td><?php echo $vehicle->getExteriorColor()?></td>
    </tr>
    <tr>
      <th>Doors</th>
      <td><?php echo $vehicle->getDoors()?> Doors</td>
    </tr>
    <tr>
      <th>Stock #:</th>
      <td><?php echo $vehicle->getStockId()?></td>
    </tr>
    <tr>
      <th>Price:</th>
      <td>$<?php echo number_format($vehicle->getPrice())?></td>
    </tr>
  </table>
  <div id="description">
    <h3>Vehicle Description:</h3>

    <p><?php echo comma_string($vehicle->getFeatureArr())?></p>
    <p><?php echo $vehicle->getDescription(ESC_RAW)?></p>
  </div>
  <div id="enquiry">
    <h3>Enquiry:</h3>
    <?php include_partial('form', array('form' => $form,'vehicle'=>$vehicle)) ?>
  </div>
</div><!--*** DETAILS END ***-->


<script type="text/javascript">
  //<![CDATA[
  function leadimageupdate(large, med){
    $('leadimage').href= large;
    $('leadimageholder').src=med;
  }
  function moveToPrevious(){
    new Effect.Move('imageboxinner', { x: 90, y: 0, transition: Effect.Transitions.sinoidal });
  }

  function moveToNext(){
    new Effect.Move('imageboxinner', { x: -90, y: 0, transition: Effect.Transitions.sinoidal });
  }

  //]]>
</script>
<style type="text/css">
  #imagebox { margin: auto; width: 360px; border: 1px #000 solid; overflow: hidden; }
  #imageboxinner { width: 10000px; }  #imageBox img { float: left; padding: 0px; margin: 0px; }
  #imagebox br { clear: both; }
</style>

<?php

$picture = $vehicle->getPictures();

if(count($picture)):

?>
<div id="imageshow" class="slideshow">
  <a rel="lightbox" href="<?php echo $vehicle->getLargeLeadImage()?>" title="<?php echo $vehicle->getName()?>" id="leadimage"><img src="<?php echo $vehicle->getMedLeadImage()?>" alt="<?php $vehicle->getName()?>" id="leadimageholder"></a>
  <a href="javascript:void(null)" onclick="moveToPrevious();"><img src="http://www.ioncannon.net/examples/slide/image/previous.png"  /></a>
  <div id="imagebox">
    <ul id="imageboxinner">
      <?php foreach($vehicle->getPictures() as $p) :?>
      <li>
        <img src="<?php echo $p->getSmallImage();?>" onclick="leadimageupdate('<?php echo $p->getLargeImage();?>','<?php echo $p->getMedImage();?>')" alt="<?php echo $vehicle->getName()?>">
      </li>
      <?php endforeach;?>
    </ul>
  </div>
  <a href="javascript:void(null)" onclick="moveToNext();"><img src="http://www.ioncannon.net/examples/slide/image/next.png"  /></a>

</div>

<?php endif;?>

<div id="main-ad">
</div>
